UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GjGoFDwLXlBlEcQcX4h/eT3OkAAYRYTmcst0nFsV0p8='
WHERE
key_id = '32f22ba7038071eaf5c92a3ac07ae6f8b81ade69f57e29550a0793e59ec86ff5'
AND (
token = 'GjGoFDwLXlBlEcQcX4h/eT3OkAAYRYTmcst0nFsV0p8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)