UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qZa3d/DRi3v2bSYUzIFOMYoZ7D1lb2xpM8NmPpbLvMk='
WHERE
key_id = 'c73ce0ecffab324d9a60acb26f11ff92df0664e3ae927148a5a64fafc6203e79'
AND (
token = 'qZa3d/DRi3v2bSYUzIFOMYoZ7D1lb2xpM8NmPpbLvMk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)