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

Query time 0.00037