UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7ZrWLVgm7cO64iChrbEtQFyyfNM3zIPVXfFU+DFPeOk='
WHERE
key_id = '52787d881037148b69843bf9267f6640ad97f99fb5842f90ab7a50b5d35b36ef'
AND (
token = '7ZrWLVgm7cO64iChrbEtQFyyfNM3zIPVXfFU+DFPeOk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)