UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '8uw2GBNqbRe6+LTKh3VcREb6S/JjSDl5lpbfeYT8aPk=' 
WHERE 
  key_id = '0d3bbc5bae0c8570982cf698e483435c19cf0a4ec437b9adee4bd6b3fa163acb' 
  AND (
    token = '8uw2GBNqbRe6+LTKh3VcREb6S/JjSDl5lpbfeYT8aPk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040