UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qMzjW7b9/GAKVYJDMgPnMxuwimTthr74hvTzZqRz1eY='
WHERE
key_id = 'c44940b58a8059d0f2d2ee2e0e62f7f2ee93a105b866867d874f08f1d69b232c'
AND (
token = 'qMzjW7b9/GAKVYJDMgPnMxuwimTthr74hvTzZqRz1eY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)