UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9K7HT/PtxOo4bX6IY3gJTW7eSt0cFHqiKNp/muSZjyM='
WHERE
key_id = 'cb28447d5c7a8d45238922d5ffcf6130ffeeed5c6036b00fca405d63d5a3f717'
AND (
token = '9K7HT/PtxOo4bX6IY3gJTW7eSt0cFHqiKNp/muSZjyM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)