UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'cvSTAMTsiLoDwpqlbcpIxlqwlUcwkGmu04jEAMNmA/E=' 
WHERE 
  key_id = '3c165b3e5902acbb69b01ff541e46cdada40f62bc1b636deb80cbf48c2a36f4c' 
  AND (
    token = 'cvSTAMTsiLoDwpqlbcpIxlqwlUcwkGmu04jEAMNmA/E=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022