UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'EqGXPMAmMu5Xth60TD9I78xB9RtDlSHPAOirMoDokaw='
WHERE
key_id = 'e3f6b29447332667a5dbc260eb99e7545e2e401b59b296b4e91e55cc434b1bda'
AND (
token = 'EqGXPMAmMu5Xth60TD9I78xB9RtDlSHPAOirMoDokaw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)