UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'yNc1BBgT5RjXiXsyomJwnfIpSJl94qXJ9FOv+8PhoFM=' 
WHERE 
  key_id = 'b3a0c0f8ab218fbc8202eab76f903f7eacc2cc0c076881a6a51de6c6d366ac66' 
  AND (
    token = 'yNc1BBgT5RjXiXsyomJwnfIpSJl94qXJ9FOv+8PhoFM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018