UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3q7KfskTrFh62fd4IwKZyA27boKDqUGJGf9BNwQJIv0='
WHERE
key_id = '29135545ac3b0f2a80d0b0f22d376a3f298b583e1efb8cbb469f332e4c7037b7'
AND (
token = '3q7KfskTrFh62fd4IwKZyA27boKDqUGJGf9BNwQJIv0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)