UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'j1HUu7xYUbGzp7kQShPdAfH20P9SCDZV1Wpq7ga93bY=' 
WHERE 
  key_id = '713b6b1716f55a83205ef03989030d34cbaa09b94834be83f9fd74cfc9ed5579' 
  AND (
    token = 'j1HUu7xYUbGzp7kQShPdAfH20P9SCDZV1Wpq7ga93bY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037