UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'E3gUI6TfNArIg3zQy6jkfeHDU/F18lKgR2aEsNnocu8='
WHERE
key_id = '97d73311e905631006cf9e2535a51aeedcf43142aa31e162ea2eb5f7187b7ef9'
AND (
token = 'E3gUI6TfNArIg3zQy6jkfeHDU/F18lKgR2aEsNnocu8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)