UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 't2llX6Efcz2qJA4A1Obj06tMcVdQGYHOVKt5jJEy51U='
WHERE
key_id = 'ad517cb08ab9e2af87ea91c84ca72763541c8b8d35794f7712c00aac756fa759'
AND (
token = 't2llX6Efcz2qJA4A1Obj06tMcVdQGYHOVKt5jJEy51U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)