UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+4dqH4pZ4CIsRNGuiAVjv1hN/bEFCn6PRkTRsJMupQY='
WHERE
key_id = '21b43281582c10bcd17ade6871c076b132564e617b5a841d38b983772f4a9c70'
AND (
token = '+4dqH4pZ4CIsRNGuiAVjv1hN/bEFCn6PRkTRsJMupQY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)