UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Jgs3coJvFCVV+YL/mwkOb9OlqCjf7JYJ/qLdRyRkFFw=' 
WHERE 
  key_id = '08c83cff4fb37fcf67fab3abfd518dac22a4ae81a5c0e7bbf19b44b685c65e17' 
  AND (
    token = 'Jgs3coJvFCVV+YL/mwkOb9OlqCjf7JYJ/qLdRyRkFFw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043