UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'EUb4izfLr/suDshC5UKS9kWx3hiC36kL/AoJBzQBc/M=' 
WHERE 
  key_id = '6fdf7661b79215479ac7ddf530801b93cf0b95bff793dcbcddbc454ff226fd5e' 
  AND (
    token = 'EUb4izfLr/suDshC5UKS9kWx3hiC36kL/AoJBzQBc/M=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00049