UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+bfgDENU1igjMTQnUdNIu3MrSNsXwXTWTJywzWUAJ9E=' 
WHERE 
  key_id = '364e2ea3c5dc50434f6aac84a117231e6619ae46d9dbb48f1782c7a6ef872277' 
  AND (
    token = '+bfgDENU1igjMTQnUdNIu3MrSNsXwXTWTJywzWUAJ9E=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041