UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2MrxkbdIm97wTua2MM/e7QtGpSalvFros93lnb2BuLk=' 
WHERE 
  key_id = 'a1b627ff7ee51c2dac7ad1361afd267098c394875722947b66fe9eda49968e24' 
  AND (
    token = '2MrxkbdIm97wTua2MM/e7QtGpSalvFros93lnb2BuLk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025