UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Vwt9o6ZYPI51a2mdRSI2vN4ur6Rc5Q0ctQiuFhUC07g=' 
WHERE 
  key_id = '4784b5d2d03a2c0174a57076c7ac1765152a5e837fa9b6ea2c86abbda2a2f217' 
  AND (
    token = 'Vwt9o6ZYPI51a2mdRSI2vN4ur6Rc5Q0ctQiuFhUC07g=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032