UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'SfmsZiyq54Sqgvi5LkL7e4jwyzAlHwBJq7ERZadtPOU=' 
WHERE 
  key_id = '7087fdda9f7e989b33f311562a1e755b47eb59bb9dae8a8e9280d6386e6d509c' 
  AND (
    token = 'SfmsZiyq54Sqgvi5LkL7e4jwyzAlHwBJq7ERZadtPOU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021