UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LAmZbwwdSQ4f3+by4Bz6nnXwRNVpKQmGbVh1O2l8EKg='
WHERE
key_id = '54eafdd9ed5fb8a54c5e5467f7de7aa925b0f8b176f201915659400c30898bb7'
AND (
token = 'LAmZbwwdSQ4f3+by4Bz6nnXwRNVpKQmGbVh1O2l8EKg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)