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

Query time 0.00027