UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'D0zcYlwJYQr4TTzhfvqjyL7k/OBMVocmgD0IkA7uqkA='
WHERE
key_id = '62b3cfd6666ed2dba06b4c232232070099fee3a9a86f69b8e580735f4b1cfd92'
AND (
token = 'D0zcYlwJYQr4TTzhfvqjyL7k/OBMVocmgD0IkA7uqkA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)