UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'dwT4zJikiCIQZL4so9lVqP+guOcHTKNyyzkHd9N9iVM=' 
WHERE 
  key_id = '3baca6d136df32bcd72315b08f39b8a070efdce519bcf8112312393da4cbca27' 
  AND (
    token = 'dwT4zJikiCIQZL4so9lVqP+guOcHTKNyyzkHd9N9iVM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041