UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jhHBy/2/xOvpfGue8IIhhOaw/Fa6HlCt+ghLz5UB3NY='
WHERE
key_id = 'c4dff7d3a46722d6c09a091cc6c4bcb2509977a6856c6d8052aa57474f7d6a21'
AND (
token = 'jhHBy/2/xOvpfGue8IIhhOaw/Fa6HlCt+ghLz5UB3NY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)