UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'mSSryo1UPvE/tNec650BWggLpyviFHfQzbnLfd5DiPw=' 
WHERE 
  key_id = '02a84908b47cd0177e9ba85bc6d84d3013bb9cc6b19b70381b58a4e263ea5210' 
  AND (
    token = 'mSSryo1UPvE/tNec650BWggLpyviFHfQzbnLfd5DiPw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037