UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+erfCtDzI58YareHVg5yaQtCqxXb86UZU04sSwGs72w=' 
WHERE 
  key_id = 'b6bf0a82e7bef6d5de2f5a67ffc4b35958aa344f32a44902cdb8edd3551bc7d7' 
  AND (
    token = '+erfCtDzI58YareHVg5yaQtCqxXb86UZU04sSwGs72w=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00078