UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fD2bYGwSokcg97/Fo2gPNqWic2oPhLrX/TEXxewm9ww='
WHERE
key_id = '1324ba86cd9e54790b863cd3c59726ffdf7b975b8a66b4f033e2ff16fa5a4ac6'
AND (
token = 'fD2bYGwSokcg97/Fo2gPNqWic2oPhLrX/TEXxewm9ww='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)