UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'VJr7OMrIXozWJ6f9cOLVhhuhXSQu6wqvJpU64gaYIag=' 
WHERE 
  key_id = '47357e071f6f8a96b87278153b0a19b5faf9e12712ec72a55fd3a49869e7687d' 
  AND (
    token = 'VJr7OMrIXozWJ6f9cOLVhhuhXSQu6wqvJpU64gaYIag=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038