UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'M4dCIMjo4zrQaE3mmWXYPfv9yUG8gWUW/4g/WIc4GgA=' 
WHERE 
  key_id = '0b248c07ea4b808fef2056ae9ef58d12229d62cb35bf9f43b4664d5da990dd34' 
  AND (
    token = 'M4dCIMjo4zrQaE3mmWXYPfv9yUG8gWUW/4g/WIc4GgA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036