UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'VBDfEP8laL+oDm3tLlFqtAQytz6myVIeR4yJ6PJLHXU=' 
WHERE 
  key_id = 'e18d141c3a212096d891c1d41a1faf896ea0f08a9ed94f00d2e18811c08c6753' 
  AND (
    token = 'VBDfEP8laL+oDm3tLlFqtAQytz6myVIeR4yJ6PJLHXU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032