UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'B62bxd1GGXuQfZ+/4xx5mK0pve0Jzi5DdJXx1nI2TXs='
WHERE
key_id = 'ed6c6576206d0c984388079a3c24f89fb497fda64ee492508ee5ba3641fd7559'
AND (
token = 'B62bxd1GGXuQfZ+/4xx5mK0pve0Jzi5DdJXx1nI2TXs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)