UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/Vp/sqNnldjz91yosyKnvxaERLJ2LXp7yw+I2lryvL8=' 
WHERE 
  key_id = '1829f31521652255d56cdf3670d0e63025d7eb228b2b24c5636312bc44b86bdb' 
  AND (
    token = '/Vp/sqNnldjz91yosyKnvxaERLJ2LXp7yw+I2lryvL8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032