UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Cxzbi6VQ+ig37xIqu4GfYZQLGfgav4AllT7gvdc5HZM='
WHERE
key_id = 'ca0f0bce5d3c01ef43257b35a2fe7cb05bdbd143a2286836cfe7befc1b54e6d1'
AND (
token = 'Cxzbi6VQ+ig37xIqu4GfYZQLGfgav4AllT7gvdc5HZM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)