UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '32VhdXWDTkk/CfwJC895zTJPtUfDx5Cg06uMptHyfn4='
WHERE
key_id = '9f72d1a7cc1e116a81391c850282183f8c425b6a7c123e8b2b7260a0dcaa5a84'
AND (
token = '32VhdXWDTkk/CfwJC895zTJPtUfDx5Cg06uMptHyfn4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)