UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/HJQX35Dmef+ZJ2Ej0PfDyR9TJYDjVLI3+lJqmJPbWk=' 
WHERE 
  key_id = '67a5e17b783099367cfed3128ac8cdca913d38f7f494fe18e4e9cb404c490569' 
  AND (
    token = '/HJQX35Dmef+ZJ2Ej0PfDyR9TJYDjVLI3+lJqmJPbWk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038