UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'sF36oCkzlM2n9fNCfQz32nZeMlaSkj63OaVwZiQB9sg='
WHERE
key_id = 'e32ef96c388bd58ba97b45070ea867814a3721a85480ccd695d029c33f1f8b0c'
AND (
token = 'sF36oCkzlM2n9fNCfQz32nZeMlaSkj63OaVwZiQB9sg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)