UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UifD8B/oeFMAJ6v6nmTZIYYbM2g4/5Q0ZPWmjeEuV08=' 
WHERE 
  key_id = 'e07803c54d94a20fb8590408cea70c341ab267fdb71528c66f83709d6d8270ef' 
  AND (
    token = 'UifD8B/oeFMAJ6v6nmTZIYYbM2g4/5Q0ZPWmjeEuV08=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045