UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'K0ovbZ+CjXnGEDBEEfM3NtE6fIxcgRsjAhHTyrrwdas='
WHERE
key_id = '3d74302f948b9fd3b9db7fd24836885b6789a2e7f3cf6029c29c04571165ff7f'
AND (
token = 'K0ovbZ+CjXnGEDBEEfM3NtE6fIxcgRsjAhHTyrrwdas='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)