UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'FWqiu6bFQ5sSEM8WWK3v+xvfAKC87qSWYlJTaN139Fw='
WHERE
key_id = 'f654c09d06a0b102dfc164e4477c498442bea64effdff172ec9ddf9e643246dd'
AND (
token = 'FWqiu6bFQ5sSEM8WWK3v+xvfAKC87qSWYlJTaN139Fw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)