UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'VAtuKW00KuiRJOGTbsBjsiz2hL1M/Lf6ymGZ5AngaXs=' 
WHERE 
  key_id = 'c45d9ebd991368845ef9f650e0f80f2e797017a2c327721743e6f86363cb9c42' 
  AND (
    token = 'VAtuKW00KuiRJOGTbsBjsiz2hL1M/Lf6ymGZ5AngaXs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028