UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8YHxgO8ur/Mbf5q/uTphKvwVsBjtRqYTST2x652OAzM='
WHERE
key_id = '00d56320aa27974d507902658e71fa49a354d63715e7e0ed37d131cecb31fa56'
AND (
token = '8YHxgO8ur/Mbf5q/uTphKvwVsBjtRqYTST2x652OAzM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)