UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Ocu12AzwEA/YesW1VDO6Aosih771QXo9RZQrStavSig=' 
WHERE 
  key_id = '6283da34503b5e2d0751e1a4c117df228e91c73a59167829b52bf610ada1c2b0' 
  AND (
    token = 'Ocu12AzwEA/YesW1VDO6Aosih771QXo9RZQrStavSig=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025