UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'SDKf+vKtsZ5jIKwOfwytEOqprWJb6yWB6ZJo18Dn3b4=' 
WHERE 
  key_id = '62f1888153e796273fbec1a7b81ddbecda9870f06b37b4567239b48e4727903c' 
  AND (
    token = 'SDKf+vKtsZ5jIKwOfwytEOqprWJb6yWB6ZJo18Dn3b4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022