UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3uScvnZcXnrG8NWYO9D9MQ79rwjElBo/S0duaB//uk4='
WHERE
key_id = '6c7eb1aa8db15cb7a0da9cc6260b9ddff1fbf19a3c3c150ebbafbfeb0c46d5a4'
AND (
token = '3uScvnZcXnrG8NWYO9D9MQ79rwjElBo/S0duaB//uk4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)