UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '8k3A5bQSiCZll46naohw9MLPOA/pUiNMEmP0R3KIPuk=' 
WHERE 
  key_id = 'f3821544ede512dfe72d0165d96cfe7bdf4f9ffea9540098bd20263b9efa55bd' 
  AND (
    token = '8k3A5bQSiCZll46naohw9MLPOA/pUiNMEmP0R3KIPuk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031