UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'egGM6LDSlJ9M2eHvbf21/pQaiMmRYSX98074e2PE4mg=' 
WHERE 
  key_id = '57dbf8a6d0338fbbbba9d841c3da421429104e1404cff24b0d5d00fe740fef7e' 
  AND (
    token = 'egGM6LDSlJ9M2eHvbf21/pQaiMmRYSX98074e2PE4mg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038