UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Ex9Dgbd7ZH5d/t9W6+G8xrGk33Ej9dcg4FrbzajM6dI='
WHERE
key_id = '4c1878ac5c3fc7a424b1d2ea6d07d820316ba07561bef9bd976ed828f977e9ec'
AND (
token = 'Ex9Dgbd7ZH5d/t9W6+G8xrGk33Ej9dcg4FrbzajM6dI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)