UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'YuW4x3dgplZDwGsOP6W3K4Ry8vIVk25LV/tZnO8pNNc=' 
WHERE 
  key_id = '28f9251e49b787f5885d5527dd0678c79d681dc528864aa4f46a4e9ef19f3068' 
  AND (
    token = 'YuW4x3dgplZDwGsOP6W3K4Ry8vIVk25LV/tZnO8pNNc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044