UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'kR4p7LEj1boC+y/d+VoxHf19fOhYCqVS11lkM/l/wkw=' 
WHERE 
  key_id = '1ea673e96b8da1d07f8729ff4e8ef645828e2c1dcc7e3d7ef6196ccf9ff8211f' 
  AND (
    token = 'kR4p7LEj1boC+y/d+VoxHf19fOhYCqVS11lkM/l/wkw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047