UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'pE9uvQq+6+uJcuH1ViLouuYa2WnM3eL4nJklEQh87MU='
WHERE
key_id = '0848d97af4b2359d487a0256e2735606aedd99b4de31af7933fd559f1626c0b3'
AND (
token = 'pE9uvQq+6+uJcuH1ViLouuYa2WnM3eL4nJklEQh87MU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)