UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'IL5Rz8P1yUcUe3r1QEDaS8XffFTniMIfZvGlC5avNCc=' 
WHERE 
  key_id = '6dcb4f72bbadcf9fec6b8b6917e3fd9949cc8dc7c4ada6d9952a087bfd3c16e9' 
  AND (
    token = 'IL5Rz8P1yUcUe3r1QEDaS8XffFTniMIfZvGlC5avNCc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030