UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ZKBNAczQguRkSxNnNKb4aBBmYJ4nARNV4w8PvWbXVEk='
WHERE
key_id = '80992bbc31e7d3709d015d5de57cc11b44d9b61ab371460251953c7cff9670f7'
AND (
token = 'ZKBNAczQguRkSxNnNKb4aBBmYJ4nARNV4w8PvWbXVEk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)