UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vMw3jqrxZzWaPKIN1hIa//sAUxvO3L61DGd/mm08pVE='
WHERE
key_id = '31adea7884dafa45b83f86df786c8bef474ec67ebb5cb5cd0808c5f3f9debe50'
AND (
token = 'vMw3jqrxZzWaPKIN1hIa//sAUxvO3L61DGd/mm08pVE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)