UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '70payvtZ4rgmjI7UncsE9uJueqwE9Lq0jNs24CYPDrQ='
WHERE
key_id = 'dd755fc46574e7b2dac92d97f7cce5a5bed75e19a7f4ac1aa1278be6d5f218ed'
AND (
token = '70payvtZ4rgmjI7UncsE9uJueqwE9Lq0jNs24CYPDrQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)