UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GzfbuVvXqSpLP180xavU0J9f+rZIdfPnNXWjN9b/9tk='
WHERE
key_id = '50bf3bf19d89d0c65944a2fe80508f7176265030cff528fe0ab905bb9b8a818f'
AND (
token = 'GzfbuVvXqSpLP180xavU0J9f+rZIdfPnNXWjN9b/9tk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)