UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0SltMxaE9jGqTfhgtPHuHa7u4oXQpe2/4NCkQKH1fMQ='
WHERE
key_id = '59d89b3b95fc12f13b00e726f2d2ceecdf14a17f36bc02a59fc558f241e42432'
AND (
token = '0SltMxaE9jGqTfhgtPHuHa7u4oXQpe2/4NCkQKH1fMQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)