UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3pwa11Kx2uZ+lKcimREwnbcnM5Xu01y+sdmwIZWWAMY='
WHERE
key_id = 'ced966b8cf0e759559a56493255866f8425da9f2123a2efb6fe75285f47351bf'
AND (
token = '3pwa11Kx2uZ+lKcimREwnbcnM5Xu01y+sdmwIZWWAMY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)