UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'oRXESDHLm4t4dUGyaYb5eVHgnQLB6nm7teyqUKA0H/U=' 
WHERE 
  key_id = '1442b6a4ccfb34d526cd0a1da5a5ed83d73f606e754670c6339a7f8fdeea07c2' 
  AND (
    token = 'oRXESDHLm4t4dUGyaYb5eVHgnQLB6nm7teyqUKA0H/U=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030