UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VqQQS7+h4REhaJbtFhgA09a7O+ydPu9Q1lCMpQT5gvQ='
WHERE
key_id = '161af4c864b7119499f71a7f8eac38e0c3e7ed56e03f0857e3631a645814f3cb'
AND (
token = 'VqQQS7+h4REhaJbtFhgA09a7O+ydPu9Q1lCMpQT5gvQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)