UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'KzliA5b3ZPrjoo7Wj/EGuRQuLFXQLwOqhstIC4uBCpI='
WHERE
key_id = '3ef07570699e47c545113d45ae0721cb676b67168a7e0be9595573084206f1d5'
AND (
token = 'KzliA5b3ZPrjoo7Wj/EGuRQuLFXQLwOqhstIC4uBCpI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)