UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'fmYObNKfVG2xEw5JHbOAqZ322fAXZ+9IiX44w3hYwRM=' 
WHERE 
  key_id = '72819fe74181595a0f3a40c145c7f01fc2d76b19ae33c4f44900ef94e52a9a39' 
  AND (
    token = 'fmYObNKfVG2xEw5JHbOAqZ322fAXZ+9IiX44w3hYwRM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038