UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '11mNKtVnh7f50zHKi6PKJp8AUDCtEdYRM3SGVwKfAZI='
WHERE
key_id = 'e468c3a89a8b457a98b77559c9a77225ab9fbb26bf8f8d75019aac43561166d8'
AND (
token = '11mNKtVnh7f50zHKi6PKJp8AUDCtEdYRM3SGVwKfAZI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)