UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'eUyD1aJXTihdxWDUVKqZqj1g9ElRmXHt86JCVfOk48o='
WHERE
key_id = '85c6653d2a670a994f85852f7e1bfb1013b1baf1b5235ff1a47f85672db6b56f'
AND (
token = 'eUyD1aJXTihdxWDUVKqZqj1g9ElRmXHt86JCVfOk48o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)