UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/8yQx1PKGxjcbUgo3KAC3mhgbrtuoMSL0yzCqK8c4/4='
WHERE
key_id = 'f03f93f692193ff994165cfc2d1f428a0cb5ebdf6ed3966975a8cd870b345add'
AND (
token = '/8yQx1PKGxjcbUgo3KAC3mhgbrtuoMSL0yzCqK8c4/4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)