UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'QaKRea900xvsAdwIPFoqPo7A6cDzogIU1rSdudAGPMc=' 
WHERE 
  key_id = '15eb6db1c201b56e4ccd95ca775391f62d33c847d57d2baaf74d76b756f2aa5d' 
  AND (
    token = 'QaKRea900xvsAdwIPFoqPo7A6cDzogIU1rSdudAGPMc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033